"""
setattr方法为类Point增加属性（变量）
"""

from Lab01 import Point

setattr(Point, 'z', 6)  # 在Point类中插入变量'z'=6
p1 = Point(4, 5)
print('Point dict is {}'.format(Point.__dict__))
print('p1 dict is {}'.format(p1.__dict__))

# getattr方法查看类Point的某个具体属性（变量）
print('p1 dict z is {}'.format(getattr(p1, 'z')))
